package com.ccz.demo.design.subscribe.javautil;

import java.util.Observable;
import java.util.Observer;

/**
 * @ClassName Observe
 * @Author caihaoyun
 * @Date 2020/4/2
 * @Version V1.0
 **/
public class Observe implements Observer {

    private int myState;

    private String myMsg;

    @Override
    public void update(Observable o, Object arg) {
        myState = ((Subject) o).getState();
        myMsg = ((Subject) o).getMessage();
    }

    public int getMyState() {
        return myState;
    }

    public void setMyState(int myState) {
        this.myState = myState;
    }

    public String getMyMsg() {
        return myMsg;
    }

    public void setMyMsg(String myMsg) {
        this.myMsg = myMsg;
    }
}
